package com.tjetc.controller;

import com.tjetc.domain.CommonQuestion;
import com.tjetc.service.CommonQuestionService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/commonQuestion")
public class CommonQuestionController {
@Resource
public CommonQuestionService commonQuestionService;

    @RequestMapping("/findAll")
    public  List<CommonQuestion> findAll(){
       return commonQuestionService.findAll();
    }
    @RequestMapping("add")
    public boolean add(@RequestParam("xuzhi") String xuzhi){
        return commonQuestionService.add(xuzhi)==1;
    }
    @RequestMapping("del")
    public boolean del(@RequestParam("id") Integer id){
        return commonQuestionService.del(id)==1;
    }
    @RequestMapping("update")
    public boolean update(@RequestBody CommonQuestion commonQuestion){
       return commonQuestionService.update(commonQuestion);
    }
}
